<!DOCTYPE html>
<html>
<head>
</head>
<body>
	<div id="tb" style="padding:20px;height:auto">
		<div>
			<form id="myform" action="${mainDomain}/btsb/export/statisticsTableView.action" class="easyui-form">
			选择年份: 
			<select id="sbnf" name="sbnf">
				<option value="2014">2014</option>
				<option value="2015">2015</option>
				<option value="2016">2016</option>
				<option value="2017">2017</option>
				<option value="2018">2018</option>
				<option value="2019">2019</option>
				<option value="2020">2020</option>
			</select>
			<a onclick="preview();" class="easyui-linkbutton" iconCls="icon-search">查询</a>
			<a onclick="downloadreport();" class="easyui-linkbutton" iconCls="icon-search">导出</a>
			</form>
		</div>
	</div>
    <div id="xldiv" style="width: 100%;height:100%;">
    	<table id="previewtb" >
    		
    	</table>
    </div>
	<script>
		var mainDomain = "${mainDomain}",miscDomain = '${mainDomain}',staticDomain = '${staticDomain}';
	</script>
	<script>
		$(document).ready(function(){
			var date=new Date;
			var year=date.getFullYear();
			$('#sbnf').val(year);
		})
	
		function downloadreport(){
			$.ajax( {  
		        type : 'POST',  
		        url : mainDomain + '/btsb/flreportyz.action',  
		        data : 'sbnf=' + $('#sbnf').val(),  
		        success : function(data) {
		        	if(data.data.status==0){
		        		document.getElementById("myform").submit();
		        	}else{
		        		$.messager.alert('提示', '该年份无统计数据', 'info');
		        	}
		        }
		    })
		}
		
		function preview(){
			$.ajax( {  
		        type : 'POST',  
		        url : mainDomain + '/btsb/previewlist.action',  
		        data : 'sbnf=' + $('#sbnf').val(),  
		        success : function(data) {
		        	if(data.data.list.length>0){
			    		var infoDiv =  '<tr>'; 
			    		    infoDiv += '<td colspan="19" style="font-weight:bold;font-size:20px;">武汉集装箱铁水联运分类情况统计表（单位：TEU）</td>';
			    		    infoDiv += '</tr>';
			    		    infoDiv += '<tr><td rowspan="2" style="font-weight:bold">申请单位</td>';
		        			infoDiv += '<td rowspan="2" style="font-weight:bold">季度</td>';
			    			infoDiv += '<td colspan="4" style="font-weight:bold">转运方式</td>';
			    			infoDiv += '<td colspan="4" style="font-weight:bold">转运车站</td>';
			    			infoDiv += '<td colspan="4" style="font-weight:bold">转运码头</td>';
			    			infoDiv += '<td colspan="4"  style="font-weight:bold">内/外贸</td>';
			    			infoDiv += '<td rowspan="2"  style="font-weight:bold">合计</td>';
			    			infoDiv += '</tr>';
			    			infoDiv += '<tr>';
			    			infoDiv += '<td style="font-weight:bold">铁路-水路</td>';
			    			infoDiv += '<td style="font-weight:bold">占比</td>';
			    			infoDiv += '<td style="font-weight:bold">水路-铁路</td>';
			    			infoDiv += '<td style="font-weight:bold">占比</td>';
			    			infoDiv += '<td style="font-weight:bold">滠口站</td>';
			    			infoDiv += '<td style="font-weight:bold">占比</td>';
			    			infoDiv += '<td style="font-weight:bold">吴家山中心站</td>';
			    			infoDiv += '<td style="font-weight:bold">占比</td>';
			    			infoDiv += '<td style="font-weight:bold">一期(WIT)</td>';
			    			infoDiv += '<td style="font-weight:bold">占比</td>';
			    			infoDiv += '<td style="font-weight:bold">二期(武港集箱)</td>';
			    			infoDiv += '<td style="font-weight:bold">占比</td>';
			    			infoDiv += '<td style="font-weight:bold">内贸箱</td>';
			    			infoDiv += '<td style="font-weight:bold">占比</td>';
			    			infoDiv += '<td style="font-weight:bold">外贸箱</td>';
			    			infoDiv += '<td style="font-weight:bold">占比</td>';
			    			infoDiv += '</tr>';
						$.each(data.data.list,function(i,v){
							infoDiv += '<tr>';
							infoDiv += '<td>'+ v.qyqc +'</td>';
							infoDiv += '<td>'+ v.sbjd +'</td>';
							infoDiv += '<td>'+ v.tscount +'</td>';
							infoDiv += '<td>'+ v.tspercent +'</td>';
							infoDiv += '<td>'+ v.stcount +'</td>';
							infoDiv += '<td>'+ v.stpercent +'</td>';
							infoDiv += '<td>'+ v.skcount +'</td>';
							infoDiv += '<td>'+ v.skpercent +'</td>';
							infoDiv += '<td>'+ v.wjscount +'</td>';
							infoDiv += '<td>'+ v.wjspercent +'</td>';
							infoDiv += '<td>'+ v.yqcount +'</td>';
							infoDiv += '<td>'+ v.yqpercent +'</td>';
							infoDiv += '<td>'+ v.eqcount +'</td>';
							infoDiv += '<td>'+ v.eqpercent +'</td>';
							infoDiv += '<td>'+ v.nmcount +'</td>';
							infoDiv += '<td>'+ v.nmpercent +'</td>';
							infoDiv += '<td>'+ v.ymcount +'</td>';
							infoDiv += '<td>'+ v.ympercent +'</td>';
							infoDiv += '<td>'+ v.yeartotal +'</td>';
							infoDiv += '/<tr>';
						});
						$("#previewtb").html(infoDiv);
		        	}else{
		        		$("#previewtb").html('');
		        		$.messager.alert('提示', '该年份无统计数据', 'info');
		        	}
		        }
		    })
		}
	</script>
	<style type="text/css"> 
		 #previewtb {width:1150px;margin-left:5px;border-right:1px solid #444444;border-bottom:1px solid #444444;}
		 #previewtb td {text-align:center;border-left:1px solid #444444;border-top:1px solid #444444;height:28px;}
	</style> 
	<script src="//cdn.bootcss.com/echarts/3.2.2/echarts.min.js"></script>
</body>
</html>